<template>
	<view class="my-search-container" :style="{backgroundColor: bgcolor}" @click="searchClickHandler">
		<view class="my-search-box" :style="{borderRadius: radius+'px'}">
			<uni-icons type="search" size="18"></uni-icons>
			<text class="search-text">搜索</text>
		</view>
	</view>
</template>

<script>
	export default {
		name: "my-search",
		data() {
			return {

			};
		},
		props: {
			bgcolor: {
				type: String,
				default: '#c00000'
			},
			radius: {
				type: Number,
				default: 18
			}
		},
		methods: {
			searchClickHandler() {
				this.$emit('xxx', {
					data: 'data'
				})
			}
		}
	}
</script>

<style lang="scss">
	.my-search-container {
		// background-color: #c00000;
		height: 50px;
		display: flex;
		justify-content: center;
		align-items: center;
		padding: 0 16px;

		.my-search-box {
			display: flex;
			justify-content: center;
			align-items: center;
			background-color: white;
			height: 36px;
			// border-radius: 36px;
			width: 100%;

			.search-text {
				margin-left: 8px;
			}
		}
	}
</style>